const express = require("express");
const db = require("../db/index");
const router = new express.Router();
const hairProjects = require("../models/hairProjects")
router.use("/", async (req, res, next) => {
    await db;
    next();
})
router.post("/hair_kind", async (req, res) => {
    console.log(req.body);
    await hairProjects.create(req.body)
    res.send("录入成功")
})
router.get("/hair_kind_search", async (req, res) => {
    const result = await hairProjects.find(req.query, {
      _id: 0,
      __v: 0
    });
    res.send(result);
  });
module.exports = router